package jee.boot.entity.activiti;

import jee.boot.common.annotation.Column;
import jee.boot.common.annotation.Table;
import jee.boot.common.annotation.Transient;

import java.util.Date;

/**
 * (运行时任务数据表)
 * （执行中实时任务）代办任务查询表
 */
@Table(name = "act_ru_task")
public class ActTask extends ActDataEntity<ActTask> {
    private static final long serialVersionUID = 1L;
    /**
     * 乐观锁
     */
    @Column(name = "REV_")
    private String rev;
    /**
     * 执行实例ID
     */
    @Column(name = "EXECUTION_ID_", data = {"execution.id", "execution.businessKey"})
    private ActExecution execution;
    /**
     * 流程实例ID
     */
    @Column(name = "PROC_INST_ID_")
    private String procInst;
    /**
     * 流程定义ID
     */
    @Column(name = "PROC_DEF_ID_", data = {"procDef.id", "procDef.name", "procDef.key", "procDef.category", "procDef.version", "procDef.resourceName", "procDef.description"})
    private ActProcDef procDef;
    /**
     * 任务名称
     */
    @Column(name = "NAME_")
    private String name;
    /**
     * 父节任务ID
     */
    @Column(name = "PARENT_TASK_ID_")
    private ActTask parentTask;
    /**
     * 任务描述
     */
    @Column(name = "DESCRIPTION_")
    private String description;
    /**
     * 任务定义key
     */
    @Column(name = "TASK_DEF_KEY_")
    private String taskDefKey;
    /**
     * 所属人,拥有者（一般情况下为空，只有在委托时才有值）
     */
    @Column(name = "OWNER_")
    private String owner;
    /**
     * 代理人员
     * 签收人或委托人
     */
    @Column(name = "ASSIGNEE_")
    private String assignee;
    /**
     * 委托类型，DelegationState分为两种：PENDING，RESOLVED。如无委托则为空
     */
    @Column(name = "DELEGATION_")
    private String delegation;
    /**
     * 优先级别，默认为：50
     */
    @Column(name = "PRIORITY_")
    private int priority;
    /**
     * 创建时间
     */
    @Column(name = "CREATE_TIME_")
    private Date createDate;
    /**
     * 执行时间
     */
    @Column(name = "DUE_DATE_")
    private Date dueDate;
    /**
     * 暂停状态 1代表激活 2代表挂起
     */
    @Column(name = "SUSPENSION_STATE_")
    private int suspensionState;
    /**
     * 表单编号
     */
    @Column(name = "FORM_KEY_")
    private String formKey;

    /**
     * 候选组
     */
    @Column(name = "ID_", key = "TASK_ID_", data = {"candidateGroup.id", "candidateGroup.groupJson"})
    private VActRuIdentitylink candidateGroup;
    /**
     * 候选人
     */
    @Column(name = "PROC_INST_ID_", key = "PROC_INST_ID_", data = {"candidateUser.id", "candidateUser.userJson"})
    private VActRuIdentitylink candidateUser;
    /**
     * 流程变量
     */
    @Column(name = "EXECUTION_ID_", key = "EXECUTION_ID_", data = {"variable.id", "variable.json"})
    private VActRuVariable variable=new VActRuVariable();
    /**
     * 审批意见
     */
    @Transient
    private String comment;

    public ActTask() {
    }

    public ActTask(String id) {
        super(id);
    }

    public String getRev() {
        return rev;
    }

    public void setRev(String rev) {
        this.rev = rev;
    }

    public ActExecution getExecution() {
        return execution;
    }

    public void setExecution(ActExecution execution) {
        this.execution = execution;
    }

    public String getProcInst() {
        return procInst;
    }

    public void setProcInst(String procInst) {
        this.procInst = procInst;
    }

    public ActProcDef getProcDef() {
        return procDef;
    }

    public void setProcDef(ActProcDef procDef) {
        this.procDef = procDef;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public ActTask getParentTask() {
        return parentTask;
    }

    public void setParentTask(ActTask parentTask) {
        this.parentTask = parentTask;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getTaskDefKey() {
        return taskDefKey;
    }

    public void setTaskDefKey(String taskDefKey) {
        this.taskDefKey = taskDefKey;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public String getAssignee() {
        return assignee;
    }

    public void setAssignee(String assignee) {
        this.assignee = assignee;
    }

    public String getDelegation() {
        return delegation;
    }

    public void setDelegation(String delegation) {
        this.delegation = delegation;
    }

    public int getPriority() {
        return priority;
    }

    public void setPriority(int priority) {
        this.priority = priority;
    }

    @Override
    public Date getCreateDate() {
        return createDate;
    }

    @Override
    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public Date getDueDate() {
        return dueDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

    public int getSuspensionState() {
        return suspensionState;
    }

    public void setSuspensionState(int suspensionState) {
        this.suspensionState = suspensionState;
    }

    public VActRuIdentitylink getCandidateGroup() {
        return candidateGroup;
    }

    public void setCandidateGroup(VActRuIdentitylink candidateGroup) {
        this.candidateGroup = candidateGroup;
    }

    public VActRuIdentitylink getCandidateUser() {
        return candidateUser;
    }

    public void setCandidateUser(VActRuIdentitylink candidateUser) {
        this.candidateUser = candidateUser;
    }

    public VActRuVariable getVariable() {
        return variable;
    }

    public void setVariable(VActRuVariable variable) {
        this.variable = variable;
    }


    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public String getFormKey() {
        return formKey;
    }

    public void setFormKey(String formKey) {
        this.formKey = formKey;
    }

    public static void main(String[] args) {
        System.out.println(new ActTask().getFindListSql());
    }

}
